package com.bole.feign;

import com.bole.data.Result;
import com.bole.dto.permission.MenuDto;
import com.bole.fallback.MenuFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(value = "bolecar-backstage-service", fallback = MenuFeignFallback.class)
public interface MenuFeign {
    @GetMapping("/menu")
    Result getMenu(@RequestParam Long id);

    @GetMapping("/menu/zTree")
    Result getzTree();

    @PostMapping("/menu")
    Result add(@RequestBody MenuDto menu);

    @GetMapping("/menu/{id}")
    Result getMenuById(@PathVariable("id") Long id);

    @PutMapping("/menu/{id}")
    Result updateById(@PathVariable("id") Long id, @RequestBody MenuDto menu);

    @DeleteMapping("/menu/{id}")
    Result deleteById(@PathVariable("id") Long id);

    @GetMapping("/menu/getzTreeChecked/{rid}")
    @ResponseBody
    Result getzTreeChecked(@PathVariable("rid") Long rid);
}
